class Animal:
    def make_sound(self):
        pass  # 抽象方法，由子类实现


class Dog(Animal):
    def make_sound(self):
        return "汪汪!"


class Cat(Animal):
    def make_sound(self):
        return "喵喵~"


class Bird(Animal):
    def make_sound(self):
        return "啾啾!"

dog = Dog()
cat = Cat()
bird = Bird()

# 多态的应用
def animal_sound(animal):
    print(animal.make_sound())  # 不关心animal具体是什么类型


# 同一个函数处理不同的对象
animal_sound(dog)   # 调用Dog的make_sound()
animal_sound(cat)   # 调用Cat的make_sound()
animal_sound(bird)  # 调用Bird的make_sound()
